/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.actions.assessmentManagement;

import cassys.actions.core.BaseAction;
import cassys.domain.assessment.Assessment;
import cassys.domain.assessment.AssessmentGroup;
import cassys.domain.assessment.AssessmentItem;
import cassys.domain.assessment.EvaluationItem;
import cassys.domain.classManagement.Module;
import cassys.domain.classManagement.Student;
import cassys.ejb.clients.AssessmentManagementDelegate;
import cassys.ejb.clients.ModuleManagementDelegate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 *
 * @author User
 */
public class EvaluateAssessment extends BaseAction {

    private long assessmentGroupId = 3l;
    private String title;
    private double markObtained;
    //private Assessment assessment;
    private Collection<Student> members;
    private Collection<EvaluationItem> evaluationItems;
    AssessmentManagementDelegate assessmentDelegate;

    public EvaluateAssessment() {

        assessmentDelegate = new AssessmentManagementDelegate();
    }

    @Override
    public String execute() throws Exception {
        AssessmentGroup assessmentGroup = assessmentDelegate.findAssessmentGroupById(getAssessmentGroupId());
        setEvaluationItems(assessmentGroup.getEvaluationItems());

        setMembers(assessmentGroup.getMembers());
        setTitle(assessmentGroup.getTitle());
        setMarkObtained(assessmentGroup.getMarkObtained());
        System.out.println("size1" + getEvaluationItems().size());
        System.out.println("size1" + getMembers().size());
        System.out.println("assessment management action started");
        return SUCCESS;
    }

    public String evaluateAssessment() throws Exception {
        return SUCCESS;
    }

    /**
     * @return the assessmentGroupId
     */
    public long getAssessmentGroupId() {
        return assessmentGroupId;
    }

    /**
     * @param assessmentGroupId the assessmentGroupId to set
     */
    public void setAssessmentGroupId(long assessmentGroupId) {
        this.assessmentGroupId = assessmentGroupId;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @return the markObtained
     */
    public double getMarkObtained() {
        return markObtained;
    }

    /**
     * @param markObtained the markObtained to set
     */
    public void setMarkObtained(double markObtained) {
        this.markObtained = markObtained;
    }

    /**
     * @return the members
     */
    public Collection<Student> getMembers() {
        return members;
    }

    /**
     * @param members the members to set
     */
    public void setMembers(Collection<Student> members) {
        this.members = members;
    }

    /**
     * @return the evaluationItems
     */
    public Collection<EvaluationItem> getEvaluationItems() {
        return evaluationItems;
    }

    /**
     * @param evaluationItems the evaluationItems to set
     */
    public void setEvaluationItems(Collection<EvaluationItem> evaluationItems) {
        this.evaluationItems = evaluationItems;
    }
}
